Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Adds new time parameter to onAfterEnvironmentCompile hook for tracking environment build duration.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 15, 2025 07:06
@netlify
Copy link

netlify bot commented Nov 15, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit e7dc991
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/691d73b87143510008247200
😎 Deploy Preview https://deploy-preview-6584--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 66 (🟢 up 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot finished reviewing on behalf of chenjiahan November 15, 2025 07:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a time parameter to the onAfterEnvironmentCompile hook to track individual environment build duration in milliseconds. The implementation includes type definitions, hook parameter updates, documentation in both English and Chinese, and test coverage.

Key Changes

  • Added time: number parameter to OnAfterEnvironmentCompileFn type definition with JSDoc documentation
  • Updated registerBuildHook and registerDevHook to extract and pass time to the hook
  • Added test assertion to verify time is greater than 0

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/core/src/types/hooks.ts Added time parameter to OnAfterEnvironmentCompileFn type with documentation
packages/core/src/hooks.ts Implemented time extraction and passing to onAfterEnvironmentCompile hook in both build and dev modes
website/docs/en/shared/onAfterEnvironmentCompile.mdx Added English documentation for the new time parameter
website/docs/zh/shared/onAfterEnvironmentCompile.mdx Added Chinese documentation for the new time parameter
e2e/cases/plugin-api/plugin-hooks-environment/index.test.ts Added test to verify time parameter is provided and greater than 0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 5e5fbc0 into main Nov 19, 2025
11 checks passed
@chenjiahan chenjiahan deleted the build_time_1115 branch November 19, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants